package com.niit.spark.sql.test

import org.apache.spark.sql.{DataFrame, SparkSession}

/**
 * Date:2025/5/12
 * Author：Ys
 * Description:
 */
object JSONToDataFrame {

  def main(args: Array[String]): Unit = {

    val spark = SparkSession.builder().appName("JSON To Dat Frame").master("local[*]").getOrCreate()
    spark.sparkContext.setLogLevel("ERROR")
    import spark.implicits._

    val df: DataFrame = spark.read.json("input/sql/users.json")

    df.show()


    spark.stop()
  }

}
